<template>
	<el-card shadow="never" header="问题与意见反馈">
		<el-form ref="epForm" :model="epForm" :rules="epRules" label-width="120px" style="margin-top:20px;">
			<el-form-item label="内容" prop="content">
				<el-input v-model="epForm.content" type="textarea" :rows="10" show-password placeholder="请输入您的宝贵意见或建议"></el-input>
			</el-form-item>
			<el-form-item>
				<el-button type="primary" @click="submit">提交</el-button>
			</el-form-item>
		</el-form>
	</el-card>
</template>

<script>

export default {
	name: "feedback",
	data(){
		return{
			epForm:{
				content:"",
			},
			epRules:{
				content:[
					{required: true, message: '请输入内容'}
				],
			},
		}
	},
	methods:{
		submit(){
			this.$refs.epForm.validate(async (valid) => {
				if (valid) {
					this.isSaving = true;
					var params = {content:this.epForm.content}
					var res = await this.$API.system.feedback.save.post(params);
					this.isSaving = false;
					if(res.success){
						this.$message.success("提交成功！感谢反馈")
					}
				}else{
					return false;
				}
			})
		},
	}
}
</script>

<style scoped>

</style>
